package labb3;

import javax.swing.*;
import java.awt.Color;
import java.awt.Font;

/**
 * Creates and shows an About dialog.
 *
 * @author Mikko Puustinen (mikko.puustinen@gmail.com)
 * @version 0.1, 2007-okt-19
 */
public class AboutDialog extends JDialog {
    AboutDialog(JFrame frame) {
        super(frame, "About", false);

        JPanel panel = new JPanel();
        panel.setLayout(new SpringLayout());
        panel.setBackground(Color.WHITE);
        add(panel);

        JLabel author = new JLabel("Author: ");
        author.setFont(new Font(Font.DIALOG, Font.BOLD, 12));
        JLabel name = new JLabel("Mikko Puustinen");
        JLabel contact = new JLabel("Contact: ");
        contact.setFont(new Font(Font.DIALOG, Font.BOLD, 12));
        JLabel mail = new JLabel("mikko.puustinen@gmail.com");
        JLabel docu = new JLabel("Documentation");
        docu.setFont(new Font(Font.DIALOG, Font.BOLD, 12));
        JLabel url = new JLabel("http://mazzer.nu/mazorg/");
        panel.add(author);
        panel.add(name);
        panel.add(contact);
        panel.add(mail);
        panel.add(docu);
        panel.add(url);

        SpringUtilities.makeCompactGrid(panel,
            3, 2, //rows, cols
            6, 6,        //initX, initY
            6, 6);       //xPad, yPad
        setLocationRelativeTo(frame);
        setModal(false);
        setResizable(false);

        pack();
        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
        setVisible(true);
    }
}
